#define  _CRT_SECURE_NO_WARNINGS 1
using namespace std;
#include<iostream>
#include<string.h>
#include <string>
class Solution {
public:
    string addStrings(string num1, string num2) {
        string str;
        int end1 = num1.size() - 1;
        int end2 = num2.size() - 1;
        int next = 0;
        while (end1 >= 0 || end2 >= 0) {
            int val1 = 0;
            int val2 = 0;
            if (end1 >= 0) {
                val1 = num1[end1] - '0';
            }
            if (end2 >= 0) {
                val2 = num2[end2] - '0';
            }
            int ret = val1 + val2 + next;
            next = ret / 10;
            ret %= 10;
            str += ('0' + ret);
            --end1;
            --end2;
        }
        if (next == 1) {
            str += ('1');
        }
        reverse(str.begin(), str.end());
        return str;
    }
};
class Solution {
public:
    bool isLetterOrNumber(char ch) {
        if (ch >= '0' && ch <= '9') {
            return true;
        }
        else if (ch >= 'a' && ch <= 'z') {
            return true;
        }
        else if (ch >= 'A' && ch <= 'Z') {
            return true;
        }
        else {
            return false;
        }
    }
    bool isPalindrome(string s) {
        int begin = 0;
        int end = s.size() - 1;
        for (auto& ch : s) {
            if (ch >= 'A' && ch <= 'Z') {
                ch += 32;
            }
        }
        while (begin < end) {
            while (begin < end && !isLetterOrNumber(s[begin])) {
                begin++;
            }
            while (begin < end && !isLetterOrNumber(s[end])) {
                end--;
            }
            if (s[begin] != s[end]) {
                return false;
            }
            else {
                begin++;
                end--;
            }
        }
        return true;
    }
};

class Solution {
public:
    string reverseStr(string s, int k) {
        int n = s.length();
        for (int i = 0; i < n; i += 2 * k) {
            reverse(s.begin() + i, s.begin() + min(i + k, n));
        }
        return s;
    }
};

class Solution {
public:
    string reverseWords(string s) {
        int len = s.size();
        int i = 0;
        while (i < len) {
            int begin = i;
            while (s[i] != ' ' && i < len) {
                i++;
            }
            int left = begin;
            int right = i;
            reverse(s.begin() + left, s.begin() + right);
            while (s[i] == ' ' && i < len) {
                i++;
            }
        }
        return s;
    }
};

class Solution {
public:
    string multiply(string num1, string num2) {
        long long num_1 = stoll(num1);
        long long num_2 = stoll(num2);
        long long num = num_1 * num_2;
        string s = to_string(num);
        return s;
    }
};

#include <iostream>
using namespace std;

int main() {
    string s;
    cin >> s;
    int len = s.size();
    int rfind = s.rfind(' ');
    if (rfind == s.npos) {
        cout << len << endl;
    }
    else {
        cout << len - rfind << endl;
    }
    return 0;
}

#include <iostream>
#include <string>
using namespace std;

int main() {
    string s;
    getline(cin, s);
    int len = s.size();
    int rfind = s.rfind(' ');
    if (rfind == s.npos) {
        cout << len << endl;
    }
    else {
        cout << len - rfind - 1 << endl;
    }
    return 0;
}